package com.itlong.cloud.POJO.DTO.property;

import com.itlong.cloud.enumerate.AppUserRoomSourceEnum;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang.StringUtils;

import java.io.Serializable;

/**
 * <desc>
 *      App用户详情页相关住户数据传输对象
 * </desc>
 *
 * @createDate 2017/09/22
 */
@Data
@NoArgsConstructor
//@EqualsAndHashCode(callSuper = true)
public class AppUserGetAuthRelationsDTO implements Serializable{
    private String userId;      //用户Id
    private String realName;    //用户姓名
    private String projectId;   //项目Id
    private String projectName;  //项目名称
    private String buildId;     //楼栋Id
    private String buildName;   //楼栋名称
    private String unitId;      //单元Id
    private String unitName;    //单元名称
    private String roomNum;     //房间号
    private String phoneNum;    //用户手机号
    private String source;  //用户的房间来源:1邀请 2注册 3管理员添加 4一卡通
    private String sourceName;  //用户的房间来源名称

    public String getSourceName() {
        if(StringUtils.isNotBlank(source)) {
            return AppUserRoomSourceEnum.getDescription(Integer.parseInt(source));
        } else {
            return source;
        }
    }
}
